---------------------------------------------------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  /Users/wesleyblundell/Dropbox/Wes_Supplemental_NEI/JAERE_Replication/Replication_package/log/FIG_A1.log
  log type:  text
 opened on:  15 May 2024, 11:50:17

. use "$rootpath/processed_data/Estimation_Data.dta", clear

. drop if key_estimation_sample==0
(273,947 observations deleted)

. 
. mkspline2 dose = treatXpost, cubic knots(0 0.15 1)

. reghdfe  log_emissions4 dose*, absorb(facility_id n5#year) vce(cluster state_number)
(MWFE estimator converged in 248 iterations)

HDFE Linear regression                            Number of obs   =    699,013
Absorbing 2 HDFE groups                           F(   2,     47) =      14.07
Statistics robust to heteroskedasticity           Prob > F        =     0.0000
                                                  R-squared       =     0.9416
                                                  Adj R-squared   =     0.9331
                                                  Within R-sq.    =     0.0011
Number of clusters (state_number) =         48    Root MSE        =     0.3080

                          (Std. Err. adjusted for 48 clusters in state_number)
------------------------------------------------------------------------------
             |               Robust
log_emissi~4 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
       dose1 |   .2733934   .1078365     2.54   0.015     .0564544    .4903324
       dose2 |  -1.339498   .3823177    -3.50   0.001    -2.108622   -.5703735
       _cons |   .6849791    .010635    64.41   0.000     .6635842    .7063739
------------------------------------------------------------------------------

Absorbed degrees of freedom:
-----------------------------------------------------+
 Absorbed FE | Categories  - Redundant  = Num. Coefs |
-------------+---------------------------------------|
 facility_id |     81432       81432           0    *|
     n5#year |      6834           1        6833     |
-----------------------------------------------------+
* = FE nested within cluster; treated as redundant for DoF computation

. mfxrcspline, link(identity) level(99) generate(test lb ub) ytitle("Marginal Effect of Policy on IHS(Emissions)") xtitle("Policy Intensity") title("Emis
> sions") graphregion(color(white))

. graph export "$rootpath/table_graph/Emissions_Spline.pdf", replace
(file /Users/wesleyblundell/Dropbox/Wes_Supplemental_NEI/JAERE_Replication/Replication_package/table_graph/Emissions_Spline.pdf written in PDF format)

. 
. gen ci_size=ub - lb

. summarize test lb ub ci_size if post==1

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
        test |    335,334   -.0174648     .140338  -.3293805   .2733934
          lb |    335,334    -.144444    .1152669  -.5200131  -.0160996
          ub |    335,334    .1095144    .1796094  -.1387478   .5628865
     ci_size |    335,334    .2539583    .1109638    .128581    .578986

. set seed 99164 //WSU's zip code. 

. bootstrap mean=r(mean), cluster(facility_id) idcluster(testgroup) group(facility_id) reps(200): summarize test if post==1
(running summarize on estimation sample)

Warning:  Because summarize is not an estimation command or does not set e(sample), bootstrap has no way to determine which observations are used in
          calculating the statistics and so assumes that all observations are used.  This means that no observations will be excluded from the
          resampling because of missing values or other reasons.

          If the assumption is not true, press Break, save the data, and drop the observations that are to be excluded.  Be sure that the dataset in
          memory contains only the relevant data.

Bootstrap replications (200)
----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 
..................................................    50
..................................................   100
..................................................   150
..................................................   200

Bootstrap results                               Number of obs     =    335,334
                                                Replications      =        200

      command:  summarize test
         mean:  r(mean)

                        (Replications based on 81,403 clusters in facility_id)
------------------------------------------------------------------------------
             |   Observed   Bootstrap                         Normal-based
             |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
        mean |  -.0174648   .0005199   -33.59   0.000    -.0184838   -.0164458
------------------------------------------------------------------------------

. set seed 99164

. bootstrap mean=r(mean), cluster(state_number) idcluster(testgroup) group(facility_id) reps(200): summarize test if post==1
(running summarize on estimation sample)

Warning:  Because summarize is not an estimation command or does not set e(sample), bootstrap has no way to determine which observations are used in
          calculating the statistics and so assumes that all observations are used.  This means that no observations will be excluded from the
          resampling because of missing values or other reasons.

          If the assumption is not true, press Break, save the data, and drop the observations that are to be excluded.  Be sure that the dataset in
          memory contains only the relevant data.

Bootstrap replications (200)
----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 
..................................................    50
..................................................   100
..................................................   150
..................................................   200

Bootstrap results                               Number of obs     =    335,334
                                                Replications      =        200

      command:  summarize test
         mean:  r(mean)

                           (Replications based on 48 clusters in state_number)
------------------------------------------------------------------------------
             |   Observed   Bootstrap                         Normal-based
             |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
        mean |  -.0174648   .0304855    -0.57   0.567    -.0772154    .0422858
------------------------------------------------------------------------------

. drop dose* test lb ub ci_size

. 
. mkspline2 dose = treatXpost, cubic knots(0 0.15 1)

. reghdfe  log_damage55 dose*, absorb(facility_id n5#year) vce(cluster state_number)
(MWFE estimator converged in 245 iterations)

HDFE Linear regression                            Number of obs   =    699,013
Absorbing 2 HDFE groups                           F(   2,     47) =       7.71
Statistics robust to heteroskedasticity           Prob > F        =     0.0013
                                                  R-squared       =     0.9406
                                                  Adj R-squared   =     0.9321
                                                  Within R-sq.    =     0.0006
Number of clusters (state_number) =         48    Root MSE        =     0.3625

                          (Std. Err. adjusted for 48 clusters in state_number)
------------------------------------------------------------------------------
             |               Robust
log_damage55 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
       dose1 |   .1926813   .1165027     1.65   0.105    -.0416919    .4270545
       dose2 |  -1.028607   .4093642    -2.51   0.015    -1.852142   -.2050727
       _cons |   .8456523   .0116939    72.32   0.000     .8221272    .8691774
------------------------------------------------------------------------------

Absorbed degrees of freedom:
-----------------------------------------------------+
 Absorbed FE | Categories  - Redundant  = Num. Coefs |
-------------+---------------------------------------|
 facility_id |     81432       81432           0    *|
     n5#year |      6834           1        6833     |
-----------------------------------------------------+
* = FE nested within cluster; treated as redundant for DoF computation

. mfxrcspline, link(identity) level(99) generate(test lb ub) ytitle("Marginal Effect of Policy on IHS(Damages)") xtitle("Policy Intensity") title("Damage
> s") graphregion(color(white))

. graph export "$rootpath/table_graph/Damages_Spline.pdf", replace
(file /Users/wesleyblundell/Dropbox/Wes_Supplemental_NEI/JAERE_Replication/Replication_package/table_graph/Damages_Spline.pdf written in PDF format)

. log close
      name:  <unnamed>
       log:  /Users/wesleyblundell/Dropbox/Wes_Supplemental_NEI/JAERE_Replication/Replication_package/log/FIG_A1.log
  log type:  text
 closed on:  15 May 2024, 12:00:57
---------------------------------------------------------------------------------------------------------------------------------------------------------
